package com.sgcc.lms.openstack.service;

import com.sgcc.lms.openstack.exception.NullTokenException;
import org.openstack4j.model.common.ActionResponse;
import org.openstack4j.model.network.*;

import java.util.List;

/**
 * @Author: 李孟帅
 * @CreateTime: 2020-07-22 10:58
 * @Description:
 */
public interface NeutronService {

    /**
     * @Author 李孟帅
     * @Description 列出网络
     * @Date 2020/7/22
     **/
    List<? extends Network> networks(String tokenId) throws NullTokenException;

    /**
     * @Author 李孟帅
     * @Description 获取网络
     * @Date 2020/7/22
     **/
    Network getNetwork(String tokenId, String id) throws NullTokenException;

    /**
     * @Author 李孟帅
     * @Description 列出子网
     * @Date 2020/7/22
     **/
    List<? extends Subnet> subnets(String tokenId) throws NullTokenException;

    /**
     * @Author 李孟帅
     * @Description 获取子网
     * @Date 2020/7/22
     **/
    Subnet getSubnet(String tokenId, String id) throws NullTokenException;

    /**
     * @Author 李孟帅
     * @Description 列出端口
     * @Date 2020/7/22
     **/
    List<? extends Port> ports(String tokenId) throws NullTokenException;

    /**
     * @Author 李孟帅
     * @Description 获取端口
     * @Date 2020/7/22
     **/
    Port getPort(String tokenId, String id) throws NullTokenException;

    /**
    * @Author 李孟帅
    * @Description 创建端口
    * @Date 2020/7/23
    **/
    Port createPort(String tokenId,Port port) throws NullTokenException;

    /**
     * @Author 李孟帅
     * @Description 删除端口
     * @Date 2020/7/22
     **/
    ActionResponse deletePort(String tokenId, String id) throws NullTokenException;

    /**
     * @Author 李孟帅
     * @Description 列出路由器
     * @Date 2020/7/22
     **/
    List<? extends Router> routers(String tokenId) throws NullTokenException;

    /**
     * @Author 李孟帅
     * @Description 获取路由器
     * @Date 2020/7/22
     **/
    Router getRouter(String tokenId, String id) throws NullTokenException;

    /**
     * @Author 李孟帅
     * @Description 列出安全组
     * @Date 2020/7/23
     **/
    List<? extends SecurityGroup> securityGroups(String tokenId) throws NullTokenException;

    /**
     * @Author 李孟帅
     * @Description 获取安全组
     * @Date 2020/7/23
     **/
    SecurityGroup getSecurityGroup(String tokenId, String id) throws NullTokenException;

    /**
     * @Author 李孟帅
     * @Description 创建安全组
     * @Date 2020/7/23
     **/
    SecurityGroup createSecurityGroup(String tokenId, SecurityGroup securityGroup) throws NullTokenException;

    /**
     * @Author 李孟帅
     * @Description 删除安全组
     * @Date 2020/7/23
     **/
    ActionResponse deleteSecurityGroup(String tokenId, String id) throws NullTokenException;

    /**
     * @Author 李孟帅
     * @Description 更新安全组
     * @Date 2020/7/23
     **/
    SecurityGroup updateSecurityGroup(String tokenId, SecurityGroup securityGroup) throws NullTokenException;

    /**
     * @Author 李孟帅
     * @Description 列出安全组规则
     * @Date 2020/7/23
     **/
    List<? extends SecurityGroupRule> securityGroupRules(String tokenId) throws NullTokenException;

    /**
     * @Author 李孟帅
     * @Description 获取安全组规则
     * @Date 2020/7/23
     **/
    SecurityGroupRule getSecurityGroupRule(String tokenId, String id) throws NullTokenException;

    /**
     * @Author 李孟帅
     * @Description 删除安全组规则
     * @Date 2020/7/23
     **/
    void deleteSecurityGroupRule(String tokenId, String id) throws NullTokenException;

    /**
     * @Author 李孟帅
     * @Description 创建安全组规则
     * @Date 2020/7/23
     **/
    SecurityGroupRule createSecurityGroupRule(String tokenId, SecurityGroupRule securityGroupRule) throws NullTokenException;
}
